package com.example.easyExcelListener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.example.entity.ReportData;
import com.example.service.ReportDataService;
import com.example.util.ReportDataUtils;

/**
 * @Author ZHAO Yudong
 * @Date 2020/11/17 11:02
 * @description：
 */
public class ReportDataListener extends AnalysisEventListener<ReportData> {

    private ReportDataService reportDataService;


    public ReportDataListener(ReportDataService reportDataService) {
        this.reportDataService = reportDataService;
    }

    @Override
    public void invoke(ReportData reportData, AnalysisContext analysisContext) {
        ReportDataUtils.add(reportData);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        reportDataService.crawler1();
    }
}
